<?php
/**
 * 控制器核心
 */
session_start();
define( 'DS' , DIRECTORY_SEPARATOR );
define( 'AROOT' , dirname( __FILE__ ) . DS  );
error_reporting(E_ALL^E_NOTICE);
ini_set( 'display_errors' , true );
require 'config.php';
require AROOT.'lib'.DS.'global.func.php';
$c = $GLOBALS['c'] = v('c') ? v('c') : c('default_controller');
$a = $GLOBALS['a'] = v('a') ? v('a') : c('default_action');
$c = basename(strtolower( z($c) ));
$a =  basename(strtolower( z($a) ));
$ext = '.php';
$cont_file = AROOT .'controller'.DS.$c.$ext;
if( !file_exists( $cont_file ) )
{
   die('Can\'t find controller file - ' . $c . $ext );
}
require_once( $cont_file );
if( !function_exists( $a ) ) die('Can\'t find method - '   . $a . ' ');
call_user_func($a);